// 守卫 高阶组件
import RouteAuthenticationGuard from "../router/routeAuthenticationGuard";
import App from "../App";
import Home from "../page/home/home";
import Basketball from "../page/basketball/basketball";
import Rugby from "../page/rugby/rugby";
// 其他组件
import NonePage from "../page/404/404";

import { createHashRouter, createBrowserRouter } from "react-router-dom";

// 配置路由映射 （不同的路由对应渲染不同的页面组件）
const router = createBrowserRouter([
  {
    path: "*",
    element: <NonePage />,
  },
  {
    path: "/",
    element: (
      <RouteAuthenticationGuard>
        <App />
      </RouteAuthenticationGuard>
    ),
    children: [
      {
        path: "/",
        element: <Home />,
      },
      {
        path: "home",
        element: <Home />,
      },
      {
        path: "rugby",
        element: <Rugby />,
      },
      {
        path: "basketball",
        element: <Basketball />,
      },
    ],
  },
]);

export default router;
